home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / WWIV Mods / WWIVMOD.ZIP / WAF016.MOD < prev    next >
Encoding:
Text File  |  1993-02-14  |  13.6 KB  |  360 lines

  1.  
  2. ┌──────────────────────────────────────────────────────────Filo─header─(c)───┐
  3. │ Mod Name:      WAF016.MOD               Author:  Wafwot #2 @2632           │
  4. │ Difficulty:    Easy/Medium              Date:    Oct 1, 1992               │
  5. │ WWIV Version:  4.22  Tested.                                               │
  6. │ Description:   Sends E-Mail to a new user from the sysop. This sends the   │
  7. │                new user E-Mail, using a file in Gfiles. Nice feature!      │
  8. └────────────────────────────────────────────────────────────────────────────┘
  9.  
  10. Addendum. This mod was the mod of the month for January 93, but it was set up
  11. for WWIV v4.21a and the Source it was installed in was modified to the point
  12. that this mod would not work in anybody elses code. It took me several hours
  13. to figure out how to get it into 4.22. It all works fine, but it does one 
  14. thing I do not understand. It prints to the SysOp log, "DATA\EMAIL username &
  15. number". I dont know why but it does. 
  16.  
  17. More Descriptive:
  18. ─────────────────
  19. Ok, I have logged on to other BBS' in the country (not WWIV) and when I have
  20. completed the newuser logon procedure, it tells me I have mail. I'm not sure, 
  21. but I think (VBBS) has this feature. This mail tells me about the sysop, some 
  22. features of the BBS, and/or other tidbits of useless <grin> information about 
  23. the BBS. It makes some of the less experienced users jump for joy, because they
  24. have mail on their first call... and you know how new users love to get mail!
  25.  
  26.  
  27.  
  28. Step 1:
  29. ───────
  30. Backup.
  31.  
  32.  
  33. Step 2:
  34. ───────
  35. Load up VARS.H and add the 'echo_off' variable to the int and extern int lists.
  36. The examples below are from MY modded source, NOT an unmodded 'clean' source. 
  37. So, if you see some variables that you don't have, don't add them. Just add the
  38. 'echo_off' variable. Sorry, I deleted the clean source... for no apparent 
  39. reason. The 'echo_off' variable is used so that when you send the newuser 
  40. E-Mail automatically, the user does not see all the lines associated with 
  41. sending a load file via E-Mail. ie, File loaded into workspace, Saving...Mail 
  42. sent to User #0, etc. It makes it seemless and invisible.
  43.  
  44.  
  45. extern int...
  46.     save_dos, screenbottom, screenlen, screenlinest, smwcheck,
  47.     statusfile, sysop_alert, tempio, topdata, topline, two_color,
  48.     userfile, usernum, useron, use_workspace, using_modem, wfc, x_only,
  49.     chat_calls, lastrandom, force_chat, echo_off;
  50.                                          /* ^ ADD THIS */
  51.  
  52.  
  53. Step 3:
  54. ───────
  55. Save VARS.H and load up NEWUSER.C. This is the actual void that sends the 
  56. E-Mail. Block copy the whole void to the end of your NEWUSER.C file.
  57.  
  58. void newuser_mail(void)
  59. {
  60.   char title[61],s[81],mail[81];
  61.   messagerec msg;
  62.  
  63.   echo_off=0;                                      /* turns 'echo_off' */
  64.   title[0]=0;                                      /* clears the title */
  65.   strcpy(s,nam(&thisuser,usernum));                /* copy username to s */
  66.   sprintf(mail,"%sNEWFORM.MSG",syscfg.gfilesdir);  /* finds the form ltr */
  67.   load_workspace(mail,1);                          /* loads form ltr */
  68.   msg.storage_type=2;                              /* set mail storage */
  69.   inmsg(&msg,title,0,0,"EMAIL",0,s,0);             /* places ltr in mail */
  70.   sendout_email(title,&msg,0,usernum,0,1,1,0,1,0);   /* sends E-Mail */
  71.   ++thisuser.waiting;                              /* so newuser can read it */
  72.   echo_off=1;                                      /* turns echo back on */
  73. }
  74.  
  75.  
  76. Step 4:
  77. ───────
  78. This is where we will call the newuser_mail void. In NEWUSER.C, this is between
  79. where the user pressed 'Q' to continue after he filled in all of his 
  80. information, and before they have to re-enter their password. I liked it here 
  81. because sending the mail will take a some (not much) time, and it DOES say 
  82. 'Please wait...' while the BBS assigns a user number. This was just the obvious
  83. place.
  84.     ok=0;
  85.     newuser_mail();                             /* ADD ME */
  86.     topscreen();
  87.     do {
  88.       nl();
  89.       nl();
  90.       npr("Your user number is: %d.\r\n",usernum);
  91.       npr("Your password is: %s.\r\n",thisuser.pw); nl();
  92.  
  93.  
  94. Step 5:
  95. ───────
  96. Since we added a new void to NEWUSER.C, load up FCNS.H and add the new 
  97. prototype to the newuser.c section.
  98.  
  99. void input_comptype(void);
  100. void input_screensize(void);
  101. void newuser_mail(void);                       /* ADD ME */
  102. void input_pw(void);
  103. void input_ansistat(void);
  104.  
  105.  
  106. Step 6:
  107. ───────
  108. Save FCNS.H (and NEWUSER.C if you didn't already), and load up MSGBASE.C.
  109. Search for void load_workspace(blahblah) and make the following changes. Again,
  110. this is making it so the newuser DOES NOT see the printed lines associated with
  111. sending mail. Make the marked lines look like what is below. I indented my 
  112. lines, because I like to be neat. <grin>
  113.  
  114.   else
  115.     use_workspace=0;
  116.   nl();
  117.   if (echo_off) {                                             /* ADD */
  118.     pl(get_string(624));                                      /* INDENT */
  119.     nl();                                                     /* INDENT */
  120.     if (!use_workspace)                                       /* INDENT */
  121.       pl(get_string(625));                                    /* INDENT */
  122.   }                                                           /* ADD */
  123. }
  124.  
  125.  
  126. Step 7:
  127. ───────
  128. Now, still in MSGBASE.C, find void inmsg(blahblah) and make the following 
  129. changes. Again, all we are doing is adding if statements to avoid printing
  130. lines that we DON'T want printed with the newuser_mail. First, find the
  131. section of code that deals with entering a title. You can just block copy
  132. what I have here, or you can make the changes. Again, this came from my
  133. modded source, so it may not be exactly what 4.21a should be.
  134.  
  135.   if (echo_off) {                                               /* ADD ME */
  136.     nl();
  137.     helpl=6;
  138.     title[0]=0;
  139.     if (okansi()) {
  140.       prt(2,get_string(326));
  141.       mpl(60);
  142.       inputl(title,60);
  143.     } else {
  144.       pl(get_string(626));                                                     
  145.  
  146.       outstr(get_string(326));
  147.       inputl(title,60);
  148.     }
  149.   }                                                             /* ADD ME */
  150.  
  151. Then directly under this section of code, add this if statement. This is
  152. making a personalized title. A nice touch, if I don't say so myself.
  153.  
  154.  if (!echo_off) {
  155.     sprintf(title,"WELCOME %s!",thisuser.name);
  156.   }
  157.  
  158.  
  159. Step 8:
  160. ───────
  161. Further down in void inmsg(blahblah) in MSGBASE.C, find this section of code 
  162. and make the indicated changes/additions.
  163.  
  164.       save=exist(fnx);
  165.       if (save) {
  166.      if (echo_off) {                                         /* ADD ME */
  167.        pl(get_string(639));                                  /* INDENT */
  168.      }                                                       /* ADD ME */
  169.       }
  170.       use_workspace=0;
  171.  
  172.  
  173. Step 9:
  174. ───────
  175. Still further down, find this code, and make THESE changes.
  176.  
  177.       case anony_real_name:
  178.      real_name=1;
  179.      *anony=0;
  180.      break;
  181.     }
  182.     if (echo_off) {                                             /* ADD ME */
  183.       outstr(get_string(91));                                   /* INDENT */
  184.     }                                                           /* ADD ME */
  185.     if (fsed) {
  186.       i5=open(fnx,O_RDONLY | O_BINARY);
  187.       l1=filelength(i5);
  188.     } else {
  189.  
  190.  
  191. Step 10:
  192. ────────
  193. Now in void sendout_email, find this code, and make the indicated changes.
  194.  
  195.     farfree(b);
  196.     farfree(b1);
  197.   }
  198.   s2[0]=0;
  199.   if (echo_off) {                                               /* ADD ME */
  200.     strcpy(s,get_string(647));                                  /* INDENT */
  201.   }                                                             /* ADD ME */
  202.   if (sy==0) {
  203.     read_user(un,&ur);
  204.     ++ur.waiting;
  205.     write_user(un,&ur);
  206.  
  207.  
  208. Step 11:
  209. ───────
  210. And now.... at the very bottom of void sendout_email, make this indicated 
  211. change.
  212.  
  213.   save_status();
  214.   if (!wfc)
  215.     topscreen();
  216.   if (echo_off)                                                 /* ADD ME */
  217.     pl(s);                                                      /* INDENT */
  218.   if (s2[0])
  219.     pl(s2);
  220. }
  221.  
  222. I know I didn't need some of those brackets, but I may add some stuff later,
  223. and they don't seem to effect anything.
  224.  
  225.  
  226. Step 12:
  227. ────────
  228. Ok, now just in case the newuser gets dumped off line, or they hangup on you in
  229. the middle of getting sent E-Mail from the newuser_mail void, we will add the 
  230. following line to LILO.C so that the echo_off variable equals 1. 'echo_off' 
  231. must ALWAYS equal 1 except when send a newuser mail from this mod. If echo_off
  232. equals 0, then your regular, registered user will not see the 'Saving...Mail 
  233. sent to Jest #1' lines that they normally do. This will force echo_off to be 1
  234. for EVERY caller. In void getuser(void), near the top, add this one line.
  235.  
  236.   ok=0;
  237.   checkit=1;
  238.   okmacro=0;
  239.   echo_off=1;                                                   /* ADD ME */
  240.   actsl=syscfg.newusersl;
  241.   if ((!net_only) && (incom)) {
  242.     sprintf(s,"%sWELCOME.ANS",syscfg.gfilesdir);
  243.     if (exist(s)) {
  244.       nl();
  245. #ifdef OLD
  246.  
  247. Step 13:
  248. ────────
  249. And again, just for safety, add this one line in XINIT.C. This will make 
  250. echo_off equal 1 whenever the BBS is loaded up. In void init(void) in XINIT.C 
  251. find this code and add the indicated line.
  252.  
  253. #ifdef EMS_XMS
  254.   if (_OvrInitEms(0,0,16)!=0)
  255.     _OvrInitExt(0L,0);
  256. #endif
  257.  
  258.   userfile=-1;
  259.   configfile=-1;
  260.   statusfile=-1;
  261.   dlf=-1;
  262.   curlsub=-1;
  263.   curldir=-1;
  264.   echo_off=1;                                                   /* ADD ME */
  265.   setvect(save_dos, getvect(INT_REAL_DOS));
  266.   oldx=0;
  267.  
  268.  
  269. Step 14:
  270. ────────
  271. That should do it. Save all files and compile/link. You will compile the whole 
  272. BBS, since we added a variable to VARS.H.
  273.  
  274. Step 15:
  275. ────────
  276. You need to create a NEWFORM.MSG file. This is the file that is sent to the 
  277. newuser.  Below is my NEWFORM.MSG. You can use it, or create your own.
  278.  
  279. ─────────────────────────────────────────────────────────────────────────────
  280.                        Welcome to Mutagenix BBS
  281.  
  282.   You have successfully logged onto one of New Brighton's most exciting
  283. bulletin boards. Thanks for calling!
  284.  
  285.   With most prompts, pressing a '?' will get you help. You will be presented
  286. with a menu of available commands for the prompt. It's really quite simple.
  287. If you do have trouble, press and hold the control key (Ctrl) while pressing
  288. the letter 'O' key. (CTRL-O). This will give you context-sensitive help
  289. throughout the BBS, anywhere you may be. 
  290.  
  291.   If you want to change any features of your new account, just press 'D'to go
  292. to D:efaults. Here, you can change just about anything pertaining to your
  293. account.
  294.  
  295.  
  296.                        The House Rules for Mutagenix
  297.                       from your Sysop -  Mutant Turtle
  298.  
  299.   The following set of rules shall be observed by all users of this BBS.
  300. Violation of any of these rules will earn the violator a citation from the
  301. dreaded SYSOP.  (Try to not collect too many of these.)
  302.  
  303. (1)       Avoid flaming at other users.  If you think the other user really
  304.         deserves a flame use E-Mail.
  305.  
  306. (2)       If the moderator of a topic insists on no conversation outside of
  307.         the topic, please respect his wishes.  Many moderators are less
  308.         tolerant of off-topic posts than your SYSOP.
  309.  
  310. (3)       Be courteous to new users.  You used to be one, remember?
  311.  
  312. (4)       This board does not carry pirated software.  Distributing same is
  313.         grand theft.  Offering to distribute it is conspiracy to commit
  314.         grand theft.
  315.  
  316.   That's enough rules.  Remember, this is your system too; try to make it as
  317. nice a place as you can.  Be involved -- post messages, converse with users
  318. and be sure to vote when there's a referendum.  Voting is what I use to find
  319. out what the users really want.  (Then I do as I please, anyway.)
  320.  
  321.  
  322.   Additional system information that you may be interested in knowing about:
  323.  
  324. (1)       Because of FCC regulations, the SYSOP is required to monitor all
  325.         traffic on the BBS and is ultimately responsible for the content
  326.         of files, E-Mail and posts.  Therefore, be advised that E-mail is
  327.         not private: I can (and do) read it.  Formally, the following notice
  328.         is presented:
  329.  
  330.      PURSUANT TO THE ELECTRONIC AND COMMUNICATIONS PRIVACY ACT OF 1986, 18
  331.      USC 2510 et. seq., NOTICE IS HEREBY GIVEN THAT THERE ARE NO FACILITIES
  332.      PROVIDED BY THIS SYSTEM FOR SENDING OR RECEIVING PRIVATE OR
  333.      CONFIDENTIAL ELECTRONIC COMMUNICATIONS.  ALL MESSAGES SHALL BE DEEMED
  334.      TO BE READILY ACCESSIBLE TO THE GENERAL PUBLIC.
  335.  
  336.        Do NOT use this system for any communication for which the sender
  337.      intends only the sender and the intended recipient or recipients to
  338.      read.
  339.  
  340.  
  341. (2)       Every 90 days the BBS will delete inactive accounts. If a user
  342.         hasn't logged in during that period, his account is deleted.
  343.         If you expect that you will not be able to log in for an extended
  344.         period or ESPECIALLY if you are using your account here just for
  345.         forwarding mail, Please notify the SYSOP so you won't be deleted.
  346.  
  347.  
  348. (3)       Now the next thing you should do when you are done reading this
  349.         is go to the Defaults area and select which Messages Sub you would
  350.         like to have in your New Scan. At first Logon only 1 Sub in set up
  351.         for you, "From the SysOp". This Sub can not be truned off.
  352.  
  353.         Thanks for trying Mutagenix BBS.
  354.                                                 Your SysOp,
  355.                                                    Mutant Turtle
  356.                                                       User #1@4251
  357.  
  358. ─────────────────────────────────────────────────────────────────────────────
  359.  
  360.